package com.iflytek.aidemo;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SplashActivity extends AppCompatActivity {

    private static final long SPLASH_DELAY_MS = 1200; // 1.2s 简洁过渡

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTheme(R.style.SplashTheme); // 确保使用无标题样式
        setContentView(R.layout.activity_splash);

        // 延迟跳转到登录页
        new Handler(Looper.getMainLooper()).postDelayed(() -> {
            try {
                Intent intent = new Intent(SplashActivity.this, LoginActivity.class);
                startActivity(intent);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                finish();
            }
        }, SPLASH_DELAY_MS);
    }
}
